<template>
  <div>
    <div class="nav">
      <button @click="toPage(0)">用户反馈</button>&nbsp;
      <button @click="toPage(1)">用户首页</button>&nbsp;
      <button @click="toPage(2)">用户个人信息</button>&nbsp;
      <button @click="toPage(3)">标注界面</button>&nbsp;
      <button @click="toPage(4)">任务详情</button>&nbsp;
      <button @click="toPage(5)">登录</button>&nbsp;
      <button @click="toPage(6)">注册</button>&nbsp;
      <button @click="toPage(7)">需求方主页</button>&nbsp;
      <button @click="toPage(8)">管理员主页</button>
    </div>
    <router-view></router-view>  
  </div>
</template>

<script setup>
import { ref } from "vue";
import { useRouter, useRoute } from "vue-router";

import { get } from "@/common";

const router = useRouter();

const pathes = [
  "/home/anno_feedback",
  "/home/anno_index",
  "/home/anno_info",
  "/home/anno_task_annotation",
  "/home/anno_task_detail",
  "/login",
  "/register",
  "/demand_home",
  "/admin_home"
];

router.push({ path: "/home/anno_index" });

const toPage = temp_index => {
  router.push({ path: pathes[temp_index] });
};
</script>

<style>
.nav {
  height: 50px;
  width: 100%;
  text-align: center;
  box-shadow: 0px 1px 5px 5px rgba(0, 0, 0, 0.05);
}
</style>